package com.rex.mq;

import org.apache.log4j.Logger;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created by frt on 2017/11/6.
 *  消费者
 */
@Component
@RabbitListener(queues = "hello")
public class Receiver {
    private static final Logger logger = Logger.getLogger(Receiver.class);

    @RabbitHandler
    public void process(String hello){
        logger.info("Receiver:" + hello);
    }
}
